//
//  InformationCell.m
//  Marketing
//
//  Created by HanenDev on 16/2/25.
//  Copyright © 2016年 Hanen 3G 01. All rights reserved.
//

#import "InformationCell.h"
#import "ViewTool.h"

#define STARTX [UIView getWidth:10]
#define CELLHEIGHT 50.0f

@implementation InformationCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        //        CGFloat cellY = 5;
        _titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(STARTX, 10, [UIView getWidth:60], 30.0f)];
        _titleLabel.textColor = lightGrayFontColor;
        [ViewTool setLableFont14:_titleLabel];
        [self.contentView addSubview:_titleLabel];
        
        _subLabel = [[UILabel alloc]initWithFrame:CGRectMake(_titleLabel.maxX +10, _titleLabel.y, [UIView getWidth:160], 30.0f)];
        _subLabel.textColor = blackFontColor;
        [ViewTool setLableFont14:_subLabel];
        [self.contentView addSubview:_subLabel];
        
        
        _qrBtn = [[UIButton alloc]init];
        [self.contentView addSubview:_qrBtn];
        
        
        _rightImg = [[UIImageView alloc]init];
        [self.contentView addSubview:_rightImg];
        
        _lineV = [[UIView alloc]init];
        _lineV.backgroundColor = grayLineColor;
        [self.contentView addSubview:_lineV];
        
    }
    return self;
}

- (void)setLineFrame:(int)index
{
    
    UIView *lineView =[[UIView alloc]init];
    lineView.backgroundColor = grayLineColor;
    
    if (index == 0) {
        
        lineView.frame = CGRectMake(STARTX, CELLHEIGHT*2 - 1, KSCreenW, 1);
        _titleLabel.frame = CGRectMake(STARTX, 35, KSCreenW -2*STARTX, 30.0f);
    }else if(index == 5){
        
        lineView.frame = CGRectMake(0, CELLHEIGHT - 1, KSCreenW, 1);
    }else{
        lineView.frame = CGRectMake(STARTX, CELLHEIGHT - 1, KSCreenW, 1);
    }
    [self.contentView addSubview:lineView];
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

@end
